add blacklistRegex to GREYConfiguration on init #1000
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Allow the user to set the blacklist for EarlGrey upon initialization of the
DetoxManager
. This will also help fix #917Why
When
device.launchApp
is called, it waits for the device to be ready. In order for the device to be ready, all the tracked Earl Grey resources must be idle. Because Earl Grey tracks all network requests by default, if there are any network calls happening, the app will be considered 'busy'.Consider the case where an app is making many network calls to an URL we wish to be blacklisted. First, the app must be launched via
device.launchApp
. Next, the blacklist needs to be set viadevice.setURLBlacklist
. However, because there is currently no way to set the blacklist upon initialization, Earl Grey will always consider the app to be 'busy' and the call todevice.launchApp
will hang.This can be solved if the user is able to pass in their own blacklist array in
launchApp
like this: